#include "arbre.h"

#include <stdlib.h>


struct noeud * creerNoeud(int type, struct noeud * f0, struct noeud * f1, struct noeud * f2, struct noeud * f3)
{
  struct noeud * n = malloc(sizeof(struct noeud));
  n->type_noeud =  type;
  n->type_var = UNDEF;
  n->allocate = 0;
  n->code=NULL;
  n->def=NULL;
  n->reg=NULL;
  n->nom=NULL;
  n->s=NULL;
  n->type_fonc=NULL;
  n->id=NULL;
  n->herite=NULL;
  n->i=-1;
  n->arg=0;
  n->f=-1.;
  n->fils[0]=f0;
  n->fils[1]=f1;
  n->fils[2]=f2;
  n->fils[3]=f3;
  return n;
}

void setString(struct noeud * n, char* s)
{
  n->s=s;
}

void setFloat(struct noeud * n, float f)
{
  n->f=f;
}

void setInt(struct noeud * n, int i)
{
  n->i=i;
}

void setID(struct noeud * n, char* id)
{
  n->id=id;
}

void setHerite(struct noeud * n, char* herite)
{
  n->herite = herite;
}
